Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] fix FilesystemInterface prefix #4277

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

Kanti
Copy link
Contributor

@Kanti Kanti commented May 24, 2024

given:
file in /app/src/extensions/aus_project/ext_tables.php with content:

<?php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_ausproject_domain_model_slide,tx_ausproject_domain_model_teaser');

running rector process --debug src/extensions/aus_project/ext_tables.php in /app directory.

Producess:

[ERROR] Could not process "src/extensions/aus_project/ext_tables.php" file, due to:
         "System error: "Unable to create a directory at /src/extensions/aus_project/Configuration/TCA/Overrides.
         mkdir(): Permission denied"

         Stack trace:
         #0 vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(297):
         League\Flysystem\UnableToCreateDirectory::atLocation('/src/extensions...', 'mkdir(): Permis...')
         #1 vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(116):
         League\Flysystem\Local\LocalFilesystemAdapter->ensureDirectoryExists('/src/extensions...', 448)
         #2 vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(102):
         League\Flysystem\Local\LocalFilesystemAdapter->writeToFile('src/extensions/...', '<?php\n\n// Inclu...',
         Object(League\Flysystem\Config))
         #3 vendor/league/flysystem/src/Filesystem.php(41):
         League\Flysystem\Local\LocalFilesystemAdapter->write('src/extensions/...', '<?php\n\n// Inclu...',
         Object(League\Flysystem\Config))
         #4 vendor/ssch/typo3-rector/src/Filesystem/FlysystemFilesystem.php(24):
         League\Flysystem\Filesystem->write('src/extensions/...', '<?php\n\n// Inclu...')
         #5
         vendor/ssch/typo3-rector/rules/CodeQuality/General/MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesR
         ector.php(121): Ssch\TYPO3Rector\Filesystem\FlysystemFilesystem->write('src/extensions/...', '<?php\n\n//
         Inclu...')
         #6 vendor/rector/rector/src/Rector/AbstractRector.php(136):
         Ssch\TYPO3Rector\CodeQuality\General\MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector->refact
         or(Object(PhpParser\Node\Stmt\Expression))
         #7 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(176):
         Rector\Rector\AbstractRector->enterNode(Object(PhpParser\Node\Stmt\Expression))
         #8 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105):
         PhpParser\NodeTraverser->traverseArray(Array)
         #9 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133):
         PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Expr\Closure))
         #10 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196):
         PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Arg))
         #11 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105):
         PhpParser\NodeTraverser->traverseArray(Array)

But should try to create files in /app/src/...

@Kanti
Copy link
Contributor Author

Kanti commented May 28, 2024

whatever happened in the main branch, this bugfix is now rebased on the current main.

@sabbelasichon
Copy link
Owner

@Kanti Thanks. Could you please fix the PHPStan error. getcwd could possibly return false

@Kanti
Copy link
Contributor Author

Kanti commented Jun 3, 2024

@sabbelasichon I fixed it with an exception, is that ok?

@sabbelasichon sabbelasichon merged commit 12c02a3 into sabbelasichon:main Jun 3, 2024
26 checks passed
@Kanti Kanti deleted the patch-4 branch June 3, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants